function sse = FitGauss(p, xdata,ydata )
        FittedCurve = gauss(p,xdata);      
        ErrorVector = FittedCurve' - ydata;
        sse = sum(ErrorVector .^ 2);
end